package pe.com.certicom.moviles.model.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import pe.com.certicom.moviles.model.beans.Reposicion;
import pe.com.certicom.moviles.model.beans.ReposicionExample;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class ReposicionDAOImpl extends SqlMapClientDaoSupport implements ReposicionDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public ReposicionDAOImpl() {
        super();
    }
    
	@Autowired
	public void createSqlMapClient(SqlMapClient sqlMapClient){
	   setSqlMapClient(sqlMapClient);
	}

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int countByExample(ReposicionExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("reposicion.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int deleteByExample(ReposicionExample example) {
        int rows = getSqlMapClientTemplate().delete("reposicion.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int deleteByPrimaryKey(Long idReposicion) {
        Reposicion key = new Reposicion();
        key.setIdReposicion(idReposicion);
        int rows = getSqlMapClientTemplate().delete("reposicion.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public void insert(Reposicion record) {
        getSqlMapClientTemplate().insert("reposicion.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public void insertSelective(Reposicion record) {
        getSqlMapClientTemplate().insert("reposicion.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    @SuppressWarnings("unchecked")
    public List<Reposicion> selectByExample(ReposicionExample example) {
        List<Reposicion> list = getSqlMapClientTemplate().queryForList("reposicion.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public Reposicion selectByPrimaryKey(Long idReposicion) {
        Reposicion key = new Reposicion();
        key.setIdReposicion(idReposicion);
        Reposicion record = (Reposicion) getSqlMapClientTemplate().queryForObject("reposicion.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int updateByExampleSelective(Reposicion record, ReposicionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("reposicion.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int updateByExample(Reposicion record, ReposicionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("reposicion.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int updateByPrimaryKeySelective(Reposicion record) {
        int rows = getSqlMapClientTemplate().update("reposicion.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    public int updateByPrimaryKey(Reposicion record) {
        int rows = getSqlMapClientTemplate().update("reposicion.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table reposicion
     *
     * @ibatorgenerated Wed Apr 24 21:35:22 COT 2013
     */
    private static class UpdateByExampleParms extends ReposicionExample {
        private Object record;

        public UpdateByExampleParms(Object record, ReposicionExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}